Imports System.Collections
Imports System.Data.OracleClient

Public Class clsGnrVar
    Dim mStrScriptCode As String = ""
  Dim mCmdData As OracleCommand
  Dim mDrData As OracleDataReader


  Public Function mfnGetCategory() As OracleDataReader

    Dim lStrQuery As String = ""

    mPrRefreshConn()
    lStrQuery = "select distinct TDCM_DATA_CTGRY from trdx_data_category_mstr order by TDCM_DATA_CTGRY"
    mCmdData = New OracleCommand(lStrQuery, con)
    mDrData = mCmdData.ExecuteReader

    Return mDrData

  End Function

  Public Function mfnAddNewAppVar(ByVal aStrCode As String) As Boolean
    Dim lStrQuery As String = ""
    Dim lIntRtn As Integer

    Try
      lStrQuery = aStrCode
      mCmdData = New OracleCommand(lStrQuery, con)
      lIntRtn = mCmdData.ExecuteNonQuery()
      'lIntRtn = mCmdData.ExecuteScalar

      If lIntRtn = 1 Then
        Return True
      Else
        Return False
      End If
    Catch ex As Exception
      MessageBox.Show(ex.Message)
      Return False
    End Try

  End Function

  Public Function mfnGetMaxSerial() As Integer
    Dim lStrQuery As String = ""
    Dim lIntMaxSerial As Integer = 0

    lStrQuery = "select max(TAV_SERIAL_NMBR) from trdx_aplctn_vrbls"
    mCmdData = New OracleCommand(lStrQuery, con)
    mDrData = mCmdData.ExecuteReader

    If mDrData.Read Then
      lIntMaxSerial = mDrData(0)
    End If

    Return lIntMaxSerial

  End Function

    Public Sub New()

    End Sub
End Class
